UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6NciFIJ6bKRW2g5xdg+PvF1kBSYeVrLNprM3AtU574E='
WHERE
key_id = 'b6cd99a3fcfdfebd00f1dca6b6ba4b81d343694ee98cc21a214733fea3ad754e'
AND (
token = '6NciFIJ6bKRW2g5xdg+PvF1kBSYeVrLNprM3AtU574E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)