UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z8OrEjhxIPky1GElLJU7HzALp28Fijxy+OPBujFRhso='
WHERE
key_id = '72792a4db8904907ac376125d1d37c3a55136dcf17b51964355d8f47d8460ee5'
AND (
token = 'z8OrEjhxIPky1GElLJU7HzALp28Fijxy+OPBujFRhso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)