UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0iCE2mLovq1LT3xIIf2tv7aKQygH8D06USFd7KhR0l4=' 
WHERE 
  key_id = 'cf1b627e52d2b7a55f18bedbb91c42e038216e43876527613c6d15743bf0ec28' 
  AND (
    token = '0iCE2mLovq1LT3xIIf2tv7aKQygH8D06USFd7KhR0l4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021