UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1M0EDTeHdHbA4kMUHalxHUgPqhZl4MOTanV2ZbeEOsI='
WHERE
key_id = '56f206fd1732bd648dfcb6efde6895e26a2513ab6c06f039f5eef2ab235bd62d'
AND (
token = '1M0EDTeHdHbA4kMUHalxHUgPqhZl4MOTanV2ZbeEOsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)