UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'laRbnQeShzYAR7L/Dc4Bgta8imwhkGRWqeIbr5G1+30='
WHERE
key_id = 'b372e4759d3dbe7a5a65a6f1ef88172e5c261d89538bbed657afc8e9866a0d72'
AND (
token = 'laRbnQeShzYAR7L/Dc4Bgta8imwhkGRWqeIbr5G1+30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)