UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tD575fmvdM1at06jsehnVxm9k+vKRmgUE7OovSoBj8g='
WHERE
key_id = '0d3f8c8d661b49dd411232d92a3755a5cc4d986e74af8b5267f8efd04ba83f3a'
AND (
token = 'tD575fmvdM1at06jsehnVxm9k+vKRmgUE7OovSoBj8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)