UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2nb5qqjcP1qtyK3cS0ksT8//VV/g6DPsoisxurj59MQ=' 
WHERE 
  key_id = '7b92133867553c0d879cb03596f109569c544365bd3605569a4435af5c4ba7f3' 
  AND (
    token = '2nb5qqjcP1qtyK3cS0ksT8//VV/g6DPsoisxurj59MQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038