UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0SiTv6XbOR2repNgAPZ/lihDD+FipHNJBZ9eXFi0VTU=' 
WHERE 
  key_id = '1324953eb92e3077c4b4e70226becd68f4621fb02c777daa44065ab9a4dc0d4d' 
  AND (
    token = '0SiTv6XbOR2repNgAPZ/lihDD+FipHNJBZ9eXFi0VTU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035