UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0hyzwsKOmlicAzJYpNDJMw6bInqeX/rWpA4rCOAxCFY='
WHERE
key_id = '6ca64627247047dbc55fe829782a991fda5ac95fa0e88385c852dab810dfa62b'
AND (
token = '0hyzwsKOmlicAzJYpNDJMw6bInqeX/rWpA4rCOAxCFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)