UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S/ukj5v6T7HBNhDJMOXO3ExXzJmlPMj9sPTLe43YBqg=' 
WHERE 
  key_id = '1dfde81092e533ac4e9db2d3b8e79eff3bf3ee99129467ea43b1be52e13e56c0' 
  AND (
    token = 'S/ukj5v6T7HBNhDJMOXO3ExXzJmlPMj9sPTLe43YBqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034