UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4A8Zuy32mSTZ/kDb/v0mNxtQZBr8zvLp0AZ8oT879nA=' 
WHERE 
  key_id = '5926844cde10301067367d85af976c283332cab3c949ea194a4bf1fb84a03d43' 
  AND (
    token = '4A8Zuy32mSTZ/kDb/v0mNxtQZBr8zvLp0AZ8oT879nA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046