UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIdoCWQCrtaCpG5BzPsPDfFDCxTg4R5hcQqdpXnFcro=' 
WHERE 
  key_id = '1795366466d8856963d0fc84f919670a1389cb12751136cf9844471c059fadb1' 
  AND (
    token = 'EIdoCWQCrtaCpG5BzPsPDfFDCxTg4R5hcQqdpXnFcro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027