UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wa5ju64RZ0AzeIVOXESbkm9RhUCElfE5jPQbMUDiT6Y=' 
WHERE 
  key_id = '080cbf6a402fae38a44bb66398f87fc3ca504e479481206be5af04ef067e23ac' 
  AND (
    token = 'Wa5ju64RZ0AzeIVOXESbkm9RhUCElfE5jPQbMUDiT6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042