UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CbMnqhWV4+NeKdJ787+qhLT7akRAV52a5NjADgOMgUc='
WHERE
key_id = '37f7832cf3d94bb88385210e21603b4a2775b0a3ae29563a84bc8813e150c97e'
AND (
token = 'CbMnqhWV4+NeKdJ787+qhLT7akRAV52a5NjADgOMgUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)