UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5oKdLm60GxEGfJTi0tCk73evtFrJgHlvYoxVxqCK7VI=' 
WHERE 
  key_id = '4bc5e740cdb6012354ebcbe0bdafcd9083208b83ec0348ee36d3f931a5f90d04' 
  AND (
    token = '5oKdLm60GxEGfJTi0tCk73evtFrJgHlvYoxVxqCK7VI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017