UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wk2DLyF4TBoQs2Q2UBpmnSqD0YLivA7Rx5y3iy6Rdw4='
WHERE
key_id = 'cf4d05326575f1899e30adf0a94bf701fabcd00bad5b107bd6b2b18106fd7b0d'
AND (
token = 'wk2DLyF4TBoQs2Q2UBpmnSqD0YLivA7Rx5y3iy6Rdw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)