UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jt9m9ynQq/gmwzj6RA1l3do4LzVZvilo/7BDGa4onb4=' 
WHERE 
  key_id = 'f50f9ab942a1a410da1bbe30c78b9c027a7f39387e01621e0f4bbb0a91b9ce53' 
  AND (
    token = 'Jt9m9ynQq/gmwzj6RA1l3do4LzVZvilo/7BDGa4onb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026