UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wG06kP29uojEE1hYZHeS4PLss/RCrtveeDrYhDgHjHs='
WHERE
key_id = 'a2e866cc6377161ce47861e35d264af4251afdc4275fadfc35842558e7de77c3'
AND (
token = 'wG06kP29uojEE1hYZHeS4PLss/RCrtveeDrYhDgHjHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)