UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/LiDgNl4R1FoPGwP5GFuhJ+7LeLvk+PyHS6pHNozXDU='
WHERE
key_id = '76a28f6a57dc5564b23af8828a1fd56b89b25dc1b1c87764173a7240be42d99c'
AND (
token = '/LiDgNl4R1FoPGwP5GFuhJ+7LeLvk+PyHS6pHNozXDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)