UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1HMYtLO7dMj5olGdc66xTEyrKNI1CwnYS6USaHb/3gE='
WHERE
key_id = 'acc38b2b9778f08a8900b930dc425b55f92ec348c22a425bdbf5c077ef6033b8'
AND (
token = '1HMYtLO7dMj5olGdc66xTEyrKNI1CwnYS6USaHb/3gE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)