UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+nvhXg3UJOod5PaNV1Rgil/7ivggtlsd/F0WG+o9jL0='
WHERE
key_id = '2b280c0b3281c87bba91db27a986d9d42a4674ecc91d44115dce997d4c5493de'
AND (
token = '+nvhXg3UJOod5PaNV1Rgil/7ivggtlsd/F0WG+o9jL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)