UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eg3V8HxAnmsC0DG2eELDIsbdznKjB6aHsibBB1pDmWo=' 
WHERE 
  key_id = '9d656615a3a85bad44cb57296ea00d231fff7e6e99898bc1a89603f5efa99f21' 
  AND (
    token = 'eg3V8HxAnmsC0DG2eELDIsbdznKjB6aHsibBB1pDmWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076