UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wyzd5LF+9JwkWaVoeflnn04fOYkVJXmY5vilZfOsMgg='
WHERE
key_id = '177b170974397f30326e0b6fd110a0055fae04f36f547f9b943550c4a30bd7ea'
AND (
token = 'wyzd5LF+9JwkWaVoeflnn04fOYkVJXmY5vilZfOsMgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)