UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iHkUkEO95J7LBeoV8kjs6nTo3ZrgieC93iVRm56al5E='
WHERE
key_id = '2a6b5f2ae3aa54f7621e1b4ed201d74ade23227dca559888285395f7045c8b59'
AND (
token = 'iHkUkEO95J7LBeoV8kjs6nTo3ZrgieC93iVRm56al5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)