UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XsVgzVi17z5OOv8qv1pSIeJriv6bKK4h+9b/cJRpj/s=' 
WHERE 
  key_id = '01d8463a67ef58275213d0b41c1b3cdc4c04ee93ed104747517d24dd62382f34' 
  AND (
    token = 'XsVgzVi17z5OOv8qv1pSIeJriv6bKK4h+9b/cJRpj/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042