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

Query time 0.00045