UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JP+WRvaYzYoeGtoJQ9zOOxK0pn3aIFfL+GCvBvV6Erg='
WHERE
key_id = 'a2863d404e9b1607c9fc1352b4d4758db3126bbaaadd769326c7d3c00b9c449e'
AND (
token = 'JP+WRvaYzYoeGtoJQ9zOOxK0pn3aIFfL+GCvBvV6Erg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)