UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O+GCHO7RPs/4wovP0d8QX43FGC5zT8U3c617qH1T0KI=' 
WHERE 
  key_id = '0cb3357e971194b6a6a5bc9f434029ccc4d4cdb7af7e9bdbb47ca024860d6e76' 
  AND (
    token = 'O+GCHO7RPs/4wovP0d8QX43FGC5zT8U3c617qH1T0KI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040