UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L1sHa+gL0ysatAimkVFGWw2IIXyVhfOYAA/rp9sRLJg=' 
WHERE 
  key_id = '6c1ef0130ee4662ce266307882e7502073b365ceabe9c7e22e082c0d8717714a' 
  AND (
    token = 'L1sHa+gL0ysatAimkVFGWw2IIXyVhfOYAA/rp9sRLJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044