UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '12bm3QwN9b1S9gnsYj4zOjuWXlUPuGUqUc1EdUf9tek='
WHERE
key_id = '9dd0b0f356c89c8c0fa6ea07a6a671dd8cb7cc1252a717ad6794447ccf3eabc0'
AND (
token = '12bm3QwN9b1S9gnsYj4zOjuWXlUPuGUqUc1EdUf9tek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)