UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C5u8CN+x/Izz/LwAW/4t4o5vKEdt3seOTzmhamIaRcc=' 
WHERE 
  key_id = '5fad9bf673707dbbc866b64e79e1da59128a910f95120ec9bb7e937662bce639' 
  AND (
    token = 'C5u8CN+x/Izz/LwAW/4t4o5vKEdt3seOTzmhamIaRcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016