UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O4xIfnDbtJ+lckwFbUZmGYAdHhVJGyJD1+5bXGiQgYc=' 
WHERE 
  key_id = '8b12a6e687520957494d928233866b7f42dd4fafc8b00535494fe08d3891d1c3' 
  AND (
    token = 'O4xIfnDbtJ+lckwFbUZmGYAdHhVJGyJD1+5bXGiQgYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017