UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wbmYDuhwEaUvzGbUNoXZb2Z2SQz2tvl4FHD73NF/NOI=' 
WHERE 
  key_id = '09ebbeef68e1261a743baefdaf5b390b3ebcca291bda566754b5a7415325fab9' 
  AND (
    token = 'wbmYDuhwEaUvzGbUNoXZb2Z2SQz2tvl4FHD73NF/NOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034