UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ASJLDVlZzQ17Egv5hqdJYDjHBGDfYGNo5onKK+iJKg='
WHERE
key_id = '7d74b3d79be354829f693357c6ac6de2838f4b21c6d41797334e6bc5a2fb2336'
AND (
token = '1ASJLDVlZzQ17Egv5hqdJYDjHBGDfYGNo5onKK+iJKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)