UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7I5O11TS8a+Gg/LxLci9BWWV5lIuKGzhON1een9BCI='
WHERE
key_id = 'b9d5c7b191b63cf5683b7a2ab9e5dd4c10711190596454a9c74efb0c0a12a6e0'
AND (
token = 's7I5O11TS8a+Gg/LxLci9BWWV5lIuKGzhON1een9BCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)