UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'faAg92Zeos43eJMficlJ2PMOF3lBl6skhJwYz0tSwc4='
WHERE
key_id = '456a8e76f923a1219779b49535430798d59d6a7408f603ee330fd5d23ba61881'
AND (
token = 'faAg92Zeos43eJMficlJ2PMOF3lBl6skhJwYz0tSwc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)