UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't1jgNM/vwo5sa1miDmhD5dUrqXUmmWTesrfiMMuNOpo=' 
WHERE 
  key_id = '3cd36f7f7a26b5b473c6bd2126b98c20d187592437f9306ab75c4cfc418e7a74' 
  AND (
    token = 't1jgNM/vwo5sa1miDmhD5dUrqXUmmWTesrfiMMuNOpo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027