UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AV27HFxbuWw81Gk00D+/ZoD3EhKc6ODxOwYj778Jpic=' 
WHERE 
  key_id = '213d8b1a4157018a73ae7ed4ebe08f0980ced0d412e3f810dd6d0d088e8ad24d' 
  AND (
    token = 'AV27HFxbuWw81Gk00D+/ZoD3EhKc6ODxOwYj778Jpic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035