UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jeg8fQDBZfxzjntR7xEGsl6ARzyQtu3VSTK69PqjauI=' 
WHERE 
  key_id = 'fb82a8b0bb3c87e0807257c7f9bcd8589093415e940f35b53d0617195bc8cc27' 
  AND (
    token = 'jeg8fQDBZfxzjntR7xEGsl6ARzyQtu3VSTK69PqjauI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047