UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vpBvGGAXPpsYwGwzmU4C2vF59+Dq4KtzjlJVOBL0Eqw='
WHERE
key_id = 'a0482e3406649def30e5b38f968f1c86121d52371b4efc621735dd8e34bb34fd'
AND (
token = 'vpBvGGAXPpsYwGwzmU4C2vF59+Dq4KtzjlJVOBL0Eqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)