UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gPLGYFVY5IPCHVguhQ5n3ZfGJG2FwnlGODSVh7oNWOQ='
WHERE
key_id = '781dff0936c8f97307e806d2561d6c60bcfd86fe2e923b0af3b8fb748f4b0282'
AND (
token = 'gPLGYFVY5IPCHVguhQ5n3ZfGJG2FwnlGODSVh7oNWOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)